
testPrinter(
'/* getter for x */;\n\
asdf = function getX() {};\n\
/* end of file */',

'/* getter for x */\n\
asdf = function getX() {};\n\
/* end of file */',

// there's an extra semicolon here, but whatever:
'/* getter for x */asdf=function getX(){};/* end of file */'
);

testPrinter(
'asdf = /* getter for x */ function getX() {};',

'/* getter for x */\n\
asdf = function getX() {};',

'/* getter for x */asdf=function getX(){}'
);

testPrinter(
'if (x) {\n\
	/* getter for x */\n\
	asdf = function getX() {};\n\
}',

'if (x) {\n\
	/* getter for x */\n\
	asdf = function getX() {};\n\
}',

'if(x){/* getter for x */asdf=function getX(){}}'
);

testPrinter(
'a(); // test',

'a();\n\
// test',

'a();// test'
);

testPrinter(
'// test\n\
a()',

'// test\n\
a();',

'// test\n\
a()'
);

testPrinter(
'if (a) { /*; a;*/ }',
'if (a) {\n\
	/*; a;*/\n\
}',
'if(a){/*; a;*/}'
);

testPrinter(
'if (a()) {\n\
	b();\n\
	// asdf\n\
}',

'if (a()) {\n\
	b();\n\
	// asdf\n\
}',

'if(a()){b();// asdf\n\
}'
);

testPrinter(
'// comment 1\n\
a()\n\
// comment 2\n\
b()\n\
// end',

'// comment 1\n\
a();\n\
// comment 2\n\
b();\n\
// end',

'// comment 1\n\
a();// comment 2\n\
b();// end'
);

testPrinter(
'/* c1 */\n\
a = function() {}\n\
/* c2 */\n\
b = function() {}\n\
/* c3 */',

'/* c1 */\n\
a = function() {};\n\
/* c2 */\n\
b = function() {};\n\
/* c3 */',

'/* c1 */a=function(){};/* c2 */b=function(){};/* c3 */'
);
